<include file="../Public/header" />
<div id="content">
    <div id="people" class="panel pure-form pure-form-stacked ts-padding20" data-title="{$_title}" selected="true" data-footer="none" data-menu="publicmenu" data-load="$.ui.squareContainer();">
        <div id="people_searchinputbox" class="pure-form">
        <div id="search_user">
            <div>
                <input type="text" id="people_searchinput" class="pure-u-1" value="<php>echo $_GET['k']</php>"/>
            </div>
        </div>
        </div>
        <div class="people-tipheader">
            共搜到{$userList.count}条结果
        </div>
        <div class="people-find-recommend" id="search_list">
            <php>if(empty($userList['data'])):</php>
                <php>if(!$lastUid){</php>
                    <p class="note">暂时没有相关用户</p>
                <php>}</php>
            <php>else:</php>
            <volist name="userList.data" id="vo">
            <div class="people-find-recommenditem">
                <div class="people-find-recommenditem-avatar ts-listen" data-listen="weibo-userpage-{$vo.uid}">
                    <img src="{$vo.avatar_middle}" alt="{$vo.uname}"/><php>if($vo['group_icon_only']):</php><a href="javascript:;" title="{$vo['group_icon_only']['user_group_name']}" class="group_icon_only"><img alt="{$vo['group_icon_only']['user_group_name']}" src="{$vo['group_icon_only']['user_group_icon_url']}" ></a><php>endif;</php>
                </div>
                <div class="people-find-recommenditem-info ts-listen" data-listen="weibo-userpage-{$vo.uid}">
                    <div class="people-find-recommenditem-infoname">{$vo.uname|getShort=4}</div>
                    <div class="people-find-recommenditem-infodes">粉丝&nbsp;<strong event-node="follower_count" event-args="uid={$vo.uid}">{$vo.user_data.follower_count|default=0}</strong></div>
                </div>
                <div class="people-find-recommenditem-followbox">
                    <php>if($GLOBALS['ts']['mid'] != $vo['uid']):</php>
                    {:W('FollowBtn', array('fid'=>$vo['uid'], 'uname'=>$vo['uname'], 'follow_state'=>$vo['follow_state'], 'type'=>'w3g'))}
                    <php>endif;</php>
                </div>
            </div>
            </volist>
            <php>if($count>20){</php>
            <!-- 分页 -->
            <div id="pager_box">
                <php>if(empty($_GET['page']) || $_GET['page']==1){</php>
                    <a href="javascript:;" link="" id="prev" class="pure-button pager_child pager_p_n_none pure-button-disabled">上一页</a>
                <php>}else{</php>
                <a href="{:U('w3g/People/search',array('k'=>$_GET['k'],'page'=>$page-1))}" id="prev" class="pure-button pager_child pager_p_n pure-button-primary">上一页</a>
                <php>}</php>
                <select id="page_sel" class="pure-button pager_child ts-listen"  data-listen="weibo-pagerSelect-change">
                    <php>
                        $_GET['page']!=0?$get=$_GET['page']:$get=1;
                        $_count = ceil($count/20);
                        if($get<6){
                        for($i=0;$i<($_count);$i++){
                        $get==$i+1?$selected='selected="selected"':$selected='';
                        if($i>9){
                        break;
                        }
                    </php>
                    <option data-index="{$i}" value="{:U('w3g/People/search',array('k'=>$_GET['k'],'page'=>$i+1))}" <php>echo $selected;</php>>第{$i+1}页</option>
                    <php>	}
                        }elseif($get>=6){
                        for($i=($get-5);$i<$get;$i++){
                        $get==$i+1?$selected='selected="selected"':$selected='';
                    </php>
                    <option data-index="{$i}" value="{:U('w3g/People/search',array('k'=>$_GET['k'],'page'=>$i+1))}" <php>echo $selected;</php>>第{$i+1}页</option>
                    <php>	}</php>
                    <php>	for($i=$get;$i<($get+5);$i++){
                        $get==$i+1?$selected='selected="selected"':$selected='';
                        if($i>$_count-1){
                        break;
                        }
                    </php>
                    <option data-index="{$i}" value="{:U('w3g/People/search',array('k'=>$_GET['k'],'page'=>$i+1))}" <php>echo $selected;</php>>第{$i+1}页</option>
                    <php>	}</php>
                    <php>}</php>

                </select>
                <php>if($get == $_count) {</php>
                <a href="javascript:;" link="" id="next" class="pure-button pager_child pager_p_n_none pure-button-disabled">下一页</a>
                <php>}else{</php>
                <a href="{:U('w3g/People/search',array('k'=>$_GET['k'],'page'=>$page+1))}" id="next" class="pure-button pager_child pager_p_n pure-button-primary">下一页</a>
                <php>}</php>
            </div>
            <php>}</php>
            <input type="hidden" id="lastUid" value="{$userList.lastUid}"/>

            <php>endif;</php>
            <input type="hidden" id="key" value="{$key}"/>
            <input type="hidden" id="curType" value="{$curType}"/>
            <input type="hidden" id="limit" value="{$limit}"/>        
        </div>
    </div>
    <script>
        //搜索更多
        /*function searchMore(){
            $.ajax({
                type : 'GET',
                data : {'k': $("#key").val(),'lastUid': $("#lastUid").val(),'t':$("#curType").val(),'limit':$("#limit").val()},
                url : U('w3g/People/searchMore'),
                success : function(data){
                    if(data){
                        $("#lastUid").remove();                        
                        $("#search_list").append(data);
                    }
                    //start_highlight(eval('('+'{$jsonKey}'+')'));
                }
            });
        }*/

        $(document).ready(function(){
            var key3 = eval('('+'{$jsonKey}'+')');
            var curType = $("#curType").val();
            start_highlight(key3);
        }); 
    </script>
<include file="../Public/footer_public" />